import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<String> list =   new ArrayList<>();
        list.add("CCCC");
        list.add("CCCC");
        list.add("CCCC");
        list.add("CCCC");
        list.add("CCCC");
        list.add("CCCC");
        Iterator<String> it = list.iterator();
        while(it.hasNext()){
            String ele = it.next();
            System.out.println(ele);
        }
        for (String ele : list) {
            System.out.println(ele);
        }
    }
}
